<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>{foreach from="$header.title" item="item" name="item"}{$item|strip_tags}{if !$smarty.foreach.item.last}-{/if}{/foreach}</title>
    <meta name="description" content="{foreach from='$header.description' item='item'}{$item|escape:input}{/foreach}" />
    <meta name="site" content="{$site_url}/" />
    <link rel="shortcut icon" href="{if $setting.webLogo}{$setting.webLogo}{else}{$site_url}/favicon.ico{/if}" type="image/x-icon" />
    <link rel="icon" href="{if $setting.webLogo}{$setting.webLogo}{else}{$site_url}/favicon.ico{/if}" type="image/x-icon" />
    {foreach from="$css" item="item"}
    {if preg_match('#http(s?)://#i', $item)}
    <link rel="stylesheet" href="{$item}" />
    {/if}
    {/foreach}
    {if $css_url}
    <link rel="stylesheet" href="{$css_url}" />
    {else}
    {foreach from="$js" item="item"}
    {if !preg_match('#http(s?)://#i', $item)}
    <link rel="stylesheet" href="{$site_url}/static/{$item}" />
    {/if}
    {/foreach}
    {/if}
    <link rel="canonical" href="{$site_url}/" />
    <link rel="alternate" hreflang="x-default" href="{$site_url}/" />
    <link rel="alternate" hreflang="zh-CN" href="{$site_url}/" />
    <link rel="alternate" type="application/rss+xml" title="{$header.title[0]}" href="{$site_url}/sitemap.xml" />
    {foreach from="$header.og_tags['og:image']" item="item" name="item"}
    {if $smarty.foreach.item.first}
    <link rel="image_src" href="{$item}" />
    <meta itemprop="image" content="{$item}" />
    <meta name="msapplication-TileImage" content="{$item}" />
    {/if}
    {/foreach}
    {foreach from="$header.og_tags" key="property" item="items" name="items"}
    {if is_array($items)}
    {foreach from="$items" item="item"}
    <meta property="{$property}" content="{$item}" />
    {/foreach}
    {else}
    <meta property="{$property}" content="{$items}" />
    {/if}
    {/foreach}
</head>

<body>
    <!-- 导航 -->
    <nav class="navbar navbar-default navbar-static-top">
        <div class="container">
            {if !$is_detail && !$is_page}<h1 class="hidden">{$setting.webName}</h1>{/if}
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" style="padding:8px 8px 8px 15px;" href="{$site_url}/" title="{$setting.webName|strip_tags}">{if $setting.webLogo}<img src="{$setting.webLogo}" style="width:32px;height:auto;" alt="{$setting.webName|strip_tags}" title="{$setting.webName|strip_tags}" />{else}{$setting.webName}{/if}</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <!-- 导航 -->
                <ul class="nav navbar-nav">
                    <li{if $category_id==0 && $page_id==0} class="active"{/if}><a href="{$site_url}/" title="首页">首页<span class="sr-only">(current)</span></a></li>
                    {foreach from="$header.nav" item="item"}
                    {if $item.children}
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{$item.name} <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            {foreach from="$item.children" item="children"}
                            <li{if $children.id==$category_id} class="active"{/if}><a href="{$children.link}" title="{$children.name|strip_tags}">{$children.name}</a></li>
                            {if $children.children}
                            <li role="separator" class="divider"></li>
                            {foreach from="$children.children" item="child"}
                            <li{if $child.id==$category_id} class="active"{/if}><a href="{$child.link}" title="{$child.name|strip_tags}">{$child.name}</a></li>
                            {/foreach}
                            {/if}
                            {/foreach}
                        </ul>
                    </li>
                    {else}
                    <li{if $item.id==$category_id} class="active"{/if}><a href="{$item.link}" title="{$item.name|strip_tags}">{$item.name}</a></li>
                    {/if}
                    {/foreach}
                    <!-- 独立页面 -->
                    {foreach from="$header.page_nav" item="item"}
                    {if $item.children}
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{$item.name} <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            {foreach from="$item.children" item="children"}
                            <li{if $children.id==$page_id} class="active"{/if}><a href="{$children.link}" title="{$children.name|strip_tags}">{$children.name}</a></li>
                            {if $children.children}
                            <li role="separator" class="divider"></li>
                            {foreach from="$children.children" item="child"}
                            <li{if $child.id==$page_id} class="active"{/if}><a href="{$child.link}" title="{$child.name|strip_tags}">{$child.name}</a></li>
                            {/foreach}
                            {/if}
                            {/foreach}
                        </ul>
                    </li>
                    {else}
                    <li{if $item.id==$page_id} class="active"{/if}><a href="{$item.link}" title="{$item.name|strip_tags}">{$item.name}</a></li>
                    {/if}
                    {/foreach}
                </ul>
                <!-- 搜索 -->
                <form class="navbar-form navbar-right" action="{$site_url}/search.html" method="get">
                    <div class="form-group">
                        <div class="input-group">
                            <input type="text" class="form-control" placeholder="搜索..." name="q" value="{$q|strip_tags}" required="required" />
                            <span class="input-group-btn">
                                <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
                            </span>
                        </div>
                    </div>
                </form>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container-fluid -->
    </nav>
    <!-- 面包屑 -->
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <ol class="breadcrumb">
                    {foreach from="$header.crumbs" item="item" name="item"}
                    {if $smarty.foreach.item.last}
                    <li class="active">{$item.name}</li>
                    {else}
                    <li><a href="{$item.link}" title="{$item.name|strip_tags}">{$item.name}</a></li>
                    {/if}
                    {/foreach}
                </ol>
            </div>
        </div>
    </div>